Displays or hides a specific pane in the explorer.
Note You can also use the Visible property of the OutlookBarPane object to display or hide the Shortcuts pane.
expression.ShowPane(Pane, Visible)
expression Required. An expression that returns an Explorer object.
Pane Required
OlPane can be one of these OlPane constants. |
olFolderList |
olOutlookBar |
olPreview |
olNavigationPane |
Visible Required. True to make the pane visible, False to hide the pane.
This Microsoft Visual Basic/Visual Basic for Applications (VBA) example uses the ShowPane and IsPaneVisible methods to hide the preview pane if it is visible or to display it if it is hidden.
Sub ShowHidePreviewPane()
Dim myOlApp As New Outlook.Application
Dim myOlExp As Outlook.Explorer
Set myOlExp = myOlApp.ActiveExplorer
myOlExp.ShowPane olPreview, _
Not myOlExp.IsPaneVisible(olPreview)
End Sub
If you use Microsoft Visual Basic Scripting Edition (VBScript) in a Microsoft Outlook form, you do not create the Application object. This example shows how to perform the same task using VBScript.
Sub CommandButton1_Click()
Set myOlExp = Application.ActiveExplorer
myOlExp.ShowPane 3, Not myOlExp.IsPaneVisible(3)
End Sub